<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditItemTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditItemLabel_itemRef}" for="itemRef" />
                    <h:inputText id="itemRef" value="#{itemController.selected.itemRef}" title="#{bundle.EditItemTitle_itemRef}" required="true" requiredMessage="#{bundle.EditItemRequiredMessage_itemRef}"/>
                    <h:outputLabel value="#{bundle.EditItemLabel_ref}" for="ref" />
                    <h:inputText id="ref" value="#{itemController.selected.ref}" title="#{bundle.EditItemTitle_ref}" required="true" requiredMessage="#{bundle.EditItemRequiredMessage_ref}"/>
                    <h:outputLabel value="#{bundle.EditItemLabel_dateAjout}" for="dateAjout" />
                    <h:inputText id="dateAjout" value="#{itemController.selected.dateAjout}" title="#{bundle.EditItemTitle_dateAjout}" required="true" requiredMessage="#{bundle.EditItemRequiredMessage_dateAjout}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditItemLabel_etat}" for="etat" />
                    <h:inputText id="etat" value="#{itemController.selected.etat}" title="#{bundle.EditItemTitle_etat}" required="true" requiredMessage="#{bundle.EditItemRequiredMessage_etat}"/>
                    <h:outputLabel value="#{bundle.EditItemLabel_dateParution}" for="dateParution" />
                    <h:inputText id="dateParution" value="#{itemController.selected.dateParution}" title="#{bundle.EditItemTitle_dateParution}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditItemLabel_magazine}" for="magazine" />
                    <h:selectOneMenu id="magazine" value="#{itemController.selected.magazine}" title="#{bundle.EditItemTitle_magazine}" >
                        <f:selectItems value="#{magazineController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditItemLabel_dvd}" for="dvd" />
                    <h:selectOneMenu id="dvd" value="#{itemController.selected.dvd}" title="#{bundle.EditItemTitle_dvd}" >
                        <f:selectItems value="#{dvdController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditItemLabel_type}" for="type" />
                    <h:selectOneMenu id="type" value="#{itemController.selected.type}" title="#{bundle.EditItemTitle_type}" required="true" requiredMessage="#{bundle.EditItemRequiredMessage_type}">
                        <f:selectItems value="#{typeItemController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditItemLabel_cd}" for="cd" />
                    <h:selectOneMenu id="cd" value="#{itemController.selected.cd}" title="#{bundle.EditItemTitle_cd}" >
                        <f:selectItems value="#{cdController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditItemLabel_revue}" for="revue" />
                    <h:selectOneMenu id="revue" value="#{itemController.selected.revue}" title="#{bundle.EditItemTitle_revue}" >
                        <f:selectItems value="#{revueController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditItemLabel_vhs}" for="vhs" />
                    <h:selectOneMenu id="vhs" value="#{itemController.selected.vhs}" title="#{bundle.EditItemTitle_vhs}" >
                        <f:selectItems value="#{vhsController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditItemLabel_livre}" for="livre" />
                    <h:selectOneMenu id="livre" value="#{itemController.selected.livre}" title="#{bundle.EditItemTitle_livre}" >
                        <f:selectItems value="#{livreController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{itemController.update}" value="#{bundle.EditItemSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditItemViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{itemController.prepareList}" value="#{bundle.EditItemShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditItemIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
